package com.hbx.controller;


import com.hbx.model.Occupation;
import com.hbx.service.OccupationService;
import com.hbx.utils.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author hbx
 * @since 2022-01-13
 */
@RestController
@RequestMapping("/occu")
@Api(tags = "职业处理器")
public class OccupationController {
    @Autowired
    private OccupationService occupationService;

    @RequestMapping(value = "/getOccuList",method = RequestMethod.GET)
    @ApiOperation("获得职业列表")
    public Result getOccuList(){
        Result r = new Result();
        List<Occupation> list = occupationService.list(null);
        return r.setCode(200).setData(list);
    }
}

